package cron

import (
	"copper-cloud/pkg/logging"
	"github.com/robfig/cron/v3"
	"os"
)

func Setup() {
	go func() {
		logging.ZapLogger.Info("定时任务开启...")
		c := cron.New()

		_, loginErr := c.AddFunc("*/30 * * * * *", SsoToken)
		if loginErr != nil {
			logging.ZapLogger.Error("获取SsoToken任务启动失败，请检查")
			os.Exit(1)
		}

		_, productErr := c.AddFunc("*/30 * * * * *", ProductList)
		if productErr != nil {
			logging.ZapLogger.Error("获取SsoToken任务启动失败，请检查")
			os.Exit(1)
		}

	}()
}



func SsoToken() {

}

func ProductList() {
	return
}
